// import React from 'react'
import { useState } from 'react'
import './TipWithdrawal.css'
import { useNavigate } from 'react-router-dom'



export default function TipWithdrawal() {
    const navigate = useNavigate()
    const back = () => {
        navigate('/rider/my')
    }
    const [tipBalance, TipBalance] = useState(114514)
    const zhuanru = () => {
        setOkShow(true);
        setTimeout(() => {
            setOkShow(false);
        }, 2000);
        TipBalance(0);
    };
    
    const [okShow, setOkShow] = useState(false)


    return (
        <div className='tx-box'>
            <div><button onClick={back}>返回</button></div>
            <div>
                <div className="tx-img">
                    <img src="https://images.669pic.com/element2/b3f965849ac6d7ca89fcea4849af5ffc.jpg" alt="" />
                </div>
                <div className='tx-text'>累积小费</div>
                <div className='tx-money'>￥{tipBalance}</div>
            </div>
            <div className='tx-btn'>
                <div>
                    <button className='tx-btn-fk' onClick={zhuanru}>转入饭卡</button>
                </div>
                <div>
                    <button className='tx-btn-vx'>转入微信</button>
                </div>
            </div>
            {okShow &&
                <div className='tips'>
                    <span>转入成功</span>
                </div>}
        </div>
    )
}
